package com.lantosec.hmrp.modules.system.vo;


import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.system.entity.SysPermission;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 系统权限表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysPermission对象", description="系统权限表")
public class SysPermissionVO extends BaseVO<SysPermission> {
    private static final long serialVersionUID = 1L;


    public SysPermissionVO(SysPermission entity){
        this.permissionId = entity.getPermissionId();
        this.permissionName = entity.getPermissionName();
        this.permissionShowName = entity.getPermissionShowName();
        this.parentId = entity.getParentId();
        this.permissionOrder = entity.getPermissionOrder();
        this.state = entity.getState();
    }

    @Override
    public SysPermission convertToEntity(){
        return new SysPermission(this);
    }


    @ApiModelProperty(value = "权限ID")
    private String permissionId;

    @ApiModelProperty(value = "权限名称(唯一)")
    private String permissionName;

    @ApiModelProperty(value = "显示名")
    private String permissionShowName;

    @ApiModelProperty(value = "上级ID")
    private String parentId;

    @ApiModelProperty(value = "排序")
    private Integer permissionOrder;

    @ApiModelProperty(value = "状态(0正常,1禁用)")
    private Integer state;

}
